The present invention relates to a data processing technology, and in particular, to a technology that is particularly effective when applied to a data processor having a higher operation mode and a lower operation mode, for example, to a technology effectively applied to a control method of a memory in a microcomputer.
Conventionally, a processor may have two program execution states, an operation mode called a supervisor state and an operation mode called a user state, where the processor is capable of operating either of the two states. For example, microprocessors similar to the 16-bit microprocessor HD68000 of Hitachi Ltd. operate in this manner. (For details refer to page 52 of the "HMCS 68000 Hitachi Microcomputer System HD68000, HD68000Y, HD6800PHD, HD68000PS Micro Processing Unit (MPU)".)
The supervisor state is a higher state of the processor program execution states and the central processing unit (CPU) can use any instructions and can access any registers in this state. The user state is a lower state of the program execution states and the CPU is not allowed to use the instructions and registers which greatly affect the system in this state. Namely, in the supervisor state, the CPU can execute a predetermined instruction which the CPU cannot execute in the user state.
As described above, with the provision of two program execution states, the microprocessor can more efficiently execute a multitask processing and the like.
Incidentally, in microcomputers having the two program execution states as described above, a bit is ordinarily disposed in a status register of the CPU for the purpose of indicating whether the processor is in the supervisor state or the user state. This would be used to indicate the current program execution state.
However, in the case where for example, a data access device such as a RAM is integrated in a microprocessor having the two program execution states, the following problem may arise. Where a CPU uses the integrated RAM as the data area while in the supervisor state, it is feared that in some cases important data may be destroyed if the CPU mistakenly accesses this data area while in the user state.